package com.ahsjdy.stcommon.enums;

import com.ahsjdy.stcommon.exception.BizException;

/**
 * @Description
 * @Author xuetao wang
 * @Date 2020/2/2
 */
public enum OrderEnum {

    待付款(0, "待付款")
    , 等待商家接单(1, "等待商家接单")
    , 待配送(2, "待配送")
    , 配送中(3, "配送中")
    , 已送达(4, "已送达")
    , 已取消(5, "已取消")
    , 待退款(6, "待退款")
    , 退款中(7, "退款中")
    , 已退款(8, "已退款");

    private int k;
    private String v;

    private OrderEnum(int k, String v) {
        this.k = k;
        this.v = v;
    }

    public static OrderEnum getEnum(int k) {
        for (OrderEnum ce : OrderEnum.values()) {
            if (ce.getK() == k) {
                return ce;
            }
        }

        throw new BizException("非法的状态");
    }

    public int getK() {
        return k;
    }

    public String getV() {
        return v;
    }
}
